import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    buttonPermission: {
      add: true,
      edit: true,
      delete: false
    }
  },
  mutations: {
    addPermission (state, { item, value }) {
      state.buttonPermission[item] = value
    }
  },
  actions: {
    setPermission ({ commit }, { item, value }) {
      commit('addPermission', { item, value })
    }
  },
  modules: {
  }
})
